/*
 * @Author: xuxu12138 1718324422@qq.com
 * @Date: 2024-06-15 11:04:33
 * @LastEditors: xuxu12138 1718324422@qq.com
 * @LastEditTime: 2024-07-01 10:18:53
 * @FilePath: /things-admin/src/base/api/apkApi.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { Result } from '@/base/Result';
import { Page } from '@/base/Page';
import { ApkModel } from '@/base/model/apkModel';
import { TableSort } from '@/base/TableSort';
import { request } from '@/base/Request';
import qs from 'qs';
export function getApkList(params: {
    pageIndex: number,
    pageSize: number,
    upgradeType?: string,
    modelId?: number
}): Promise<Result<Page<ApkModel>>> {
    Object.assign(params, TableSort());
    return request.getPage(ApkModel, '/api/app-update', { params });
}
export function deleteApkItem(id: number): Promise<Result<void>> {
    return request.delete(`/api/app-update/${id}`);
}
export function addApkVersion(params: {
    downloadUrl: string,
    apkSize: number,
    modifyContent: string,
    upgradeType: string,
    versionCode: number,
    versionName: string,
    updateStatus: number
    apkMd5?: string,
    modelId?: number,
    detailedContent: string
}) {
    return request.post(ApkModel, '/api/app-update', qs.stringify(params));
}
// /api/app-update
export function putApkVersion(params: {
    id:number,
    downloadUrl: string,
    apkSize: number,
    modifyContent: string,
    upgradeType: string,
    versionCode: number,
    versionName: string,
    updateStatus: number
    apkMd5?: string,
    modelId?: number,
    detailedContent: string
}) {
    return request.put(ApkModel, '/api/app-update', qs.stringify(params));
}
